package com.atlin.consumer;

import com.atlin.model.UserInfo;
import com.atlin.nrpc.core.proxy.ServiceProxyFactory;
import com.atlin.service.UserInfoService;

/**
 * 简易版服务消费示例
 */
public class EasyConsumerExample {
    public static void main(String[] args) {

        UserInfoService userInfoService = null;
        UserInfo userInfo = new UserInfo();
        userInfo.setName("LHH");
        userInfo.setAge(18);
//        userInfoService = new UserInfoServiceProxy();
        userInfoService = ServiceProxyFactory.getProxy(UserInfoService.class);

        if (userInfoService != null) {
            UserInfo res = userInfoService.queryUserInfo(userInfo);
            System.out.println(res);

        } else {
            System.out.print("userService == null");
        }
    }
}
